import React from 'react';
import ReactECharts from 'echarts-for-react';

const EChartsDemo = () => {
  const options = {
    title: {
      text: '示例折线图',
    },
    tooltip: {
      trigger: 'axis',
    },
    xAxis: {
      type: 'category',
      data: ['一月', '二月', '三月', '四月', '五月', '六月'],
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        name: '销售额',
        type: 'line',
        data: [820, 932, 901, 934, 1290, 1330],
      },
    ],
  };

  return (
    <div>
      <ReactECharts option={options} style={{ height: '400px', width: '100%' }} />
    </div>
  );
};

export default EChartsDemo;
